let count = 0;
function getCount() {
  count += 1;
  return count;
}
function foo(v = getCount()) {
  console.log(`v = ${v}`);
}
foo(); // v = 1
foo(); // v = 2
